﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace vxi.chat.library
{
    /// <summary>
    /// 所有用户的基类
    /// </summary>
    [Serializable]
    public abstract class VxiUserBase
    {
        protected string _userName;             ///< 用户标识
        protected IPEndPoint _remotePoint;         ///< 用户外网地址（包括IP和PORT）
        protected IPEndPoint _localPoint;       ///< 用户内网地址（包括IP和PORT）
        protected bool _conntected;             ///< 打洞标记    
        protected DateTime _lastactionTime;     ///< 客户端最后响应时间

        protected string _serverName;

        public string ServerName
        {
            get { return _serverName; }
            set { _serverName = value; }
        }

        public DateTime LastactionTime
        {
            get { return _lastactionTime; }
            set { _lastactionTime = value; }
        }

        public bool Conntected
        {
            get { return _conntected; }
            set { _conntected = value; }
        }

        public string UserName
        {
            get { return _userName; }
            set { _userName = value; }
        }

        public IPEndPoint RemotePoint
        {
            get { return _remotePoint; }
            set { _remotePoint = value; }
        }
        public IPEndPoint LocalPoint
        {
            get { return _localPoint; }
            set { _localPoint = value; }
        }

        public void UpdateLastTime()
        {
            this._lastactionTime = DateTime.Now;
        }

    }
}
